package cn.sofwin.day0120.homework.Menu;

import java.util.Scanner;

public class Menu {
    public static Scanner sc = new Scanner(System.in);

    public void showLoginMenu(){
        System.out.println("欢迎使用我行我素购物管理系统");
        System.out.println("\t\t1.登录系统");
        System.out.println("\t\t2.退出");
        System.out.println("***************************");
        System.out.print("请选择，输入数字：");
        switch (sc.nextInt()) {
            case 1:
                showMainMenu();
                break;
            case 2:
                return;
            default:
                System.out.println("请检查输入是否有误");
                showLoginMenu();
        }
    }

    public void showMainMenu(){
        System.out.println("我行我素购物管理系统主菜单");
        System.out.println("\t\t1.客户信息管理");
        System.out.println("\t\t2.真情回馈");
        System.out.println("***************************");
        System.out.print("请选择，输入数字或按0返回上一级菜单：");
        switch (sc.nextInt()) {
            case 0:
                showLoginMenu();
                break;
            case 1:
                showCustMenu();
                break;
            case 2:
                showSendGMenu();
                break;
            default:
                System.out.println("请检查输入是否有误");
                showMainMenu();
        }
    }

    public void showCustMenu(){
        System.out.println("*******客户信息管理*******");
    }

    public void showSendGMenu(){
        System.out.println("我行我素购物管理系统 > 真情回馈");
        System.out.println("\t\t1.幸运大放送");
        System.out.println("\t\t2.幸运抽奖");
        System.out.println("\t\t3.生日问候");
        System.out.println("***************************");
        System.out.print("请选择，输入数字或按0返回上一级菜单：");
        switch (sc.nextInt()) {
            case 0:
                showMainMenu();
                break;
            case 1:
                luckySend();
                break;
            case 2:
                luckyGet();
                break;
            case 3:
                birthGreet();
                break;
            default:
                System.out.println("请检查输入是否有误");
                showSendGMenu();
        }
    }

    public void luckySend(){
        System.out.println("*****幸运大放送*****");
    }

    public void luckyGet(){
        System.out.println("*****幸运抽奖*****");
    }

    public void birthGreet(){
        System.out.println("*****生日快乐*****");
    }
}
